﻿using HDJ.Framework.Core;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace HDJ.Framework.Core
{
    
    //public class ServerResourceLoader : LoaderBase
    //{
    //    private Dictionary<string, AssetData[]> assetCacheDic = new Dictionary<string, AssetData[]>();
    //    public AssetData[] LoadAssets(string path)
    //    {
    //        if (assetCacheDic.ContainsKey(path))
    //            return assetCacheDic[path];
    //        path = Environment.CurrentDirectory + "/Resources/" + path;
    //        AssetData[] rds = null;
    //        object ass = FileUtils.LoadByteFileByPath(path);
    //        if (ass != null)
    //        {
    //            rds = new AssetData[1];
    //            rds[0] = new AssetData(path);
    //            rds[0].asset = ass;
    //            assetCacheDic.Add(path, rds);
    //        }
    //        else
    //        {
    //            Debug.LogError("加载失败,Path:" + path);
    //        }
    //        if (rds == null)
    //            rds = new AssetData[0];
    //        return rds;
    //    }

    //    public IEnumerator LoadAssetsIEnumerator(string path, CallBack<AssetData[]> callBack)
    //    {
    //        throw new NotImplementedException();
    //    }

    //    public void Release(string path)
    //    {
    //        if (assetCacheDic.ContainsKey(path))
    //        {
    //            assetCacheDic.Remove(path);
    //        }
    //    }

    //    public void ReleaseAll()
    //    {
    //        assetCacheDic.Clear();
    //    }
    //}
}
